﻿namespace RStudio.UnitSingleton
{
    /// <summary>
    /// 单例管理接口
    /// </summary>
    public interface IGameServiceLocater
    {
        /// <summary>
        /// 获取|服务
        /// </summary>
        /// <remarks>
        /// 要求所有服务必须实现 IGameService 接口，并显示执行 <see href="IGameServiceLocater.Register{T}(T)"></see> 方法
        /// </remarks>
        public T GetService<T>() where T : class, IGameService;

        /// <summary>
        /// 注册|服务
        /// </summary>
        public void Register<T>(T service) where T : class, IGameService;

        /// <summary>
        /// 注册|批量服务
        /// </summary>
        public void Registers(params IGameService[] services);

        /// <summary>
        /// 注销|服务
        /// </summary>
        public void Unregister<T>() where T : class, IGameService;

        /// <summary>
        /// 判断|服务已注册
        /// </summary>
        public bool IsServiceRegistered<T>() where T : class, IGameService;
    }
}
